package com.zzjson.design.proxy.jdk;

import sun.misc.ProxyGenerator;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2018 rollBall team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : cn.gson.aop</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2018年11月30日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
public class TestFindLove {
    public static void main(String[] args) {
        //new LiSi().findLove();
        MeiPo meiPo = new MeiPo();
        Person person = (Person) meiPo.getInstance(new LiSi());
        person.findLove();
        byte[] data = ProxyGenerator.generateProxyClass("$Proxy0", new Class[]{person.getClass()});
        try {
            FileOutputStream os = new FileOutputStream("$Proxy0.class");
            os.write(data);
            os.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}